﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XT.Model;
using XT.Repository;

namespace XT.BusinessService
{
    

    public class CityService : ICityService
    {
        private readonly IUow _uow;
        public CityService(IUow uow)
        {
            _uow = uow;
        }
 
        public IEnumerable<City> GetCitys()
        {
            return _uow.CityRepo.FindAll<City>(o => o.OrderByDescending(c => c.Id));
        }

        public City getCityById(int id)
        {
            return _uow.CityRepo.Find(id);
        }
    }
}
